ostbuild: Take advantage of link cache
authorColin Walters <walters@verbum.org>
Fri, 13 Apr 2012 20:10:40 +0000 (16:10 -0400)
committerColin Walters <walters@verbum.org>
Fri, 13 Apr 2012 20:10:40 +0000 (16:10 -0400)
This greatly speeds up construction of buildroots.

src/ostbuild/pyostbuild/builtin_chroot_compile_one.py

index fa29be99d5515efd15d5f6e923f85a9996c88e5a..0c6a96cad46cfde64e0ba6af5da967048868d0cb 100755 (executable)
@@ -45,9 +45,12 @@ class OstbuildChrootCompileOne(builtins.Builtin):
             checkout_trees.append((buildname, '/runtime'))
             checkout_trees.append((buildname, '/devel'))
 
+        link_cache_dir = os.path.join(self.workdir, 'link-cache')
+        fileutil.ensure_dir(link_cache_dir)
+
         for (branch, rootpath) in checkout_trees:
             run_sync(['ostree', '--repo=' + self.repo,
-                      'checkout', '--user-mode',
+                      'checkout', '--user-mode', '--link-cache=' + link_cache_dir,
                       '--union', '--subpath=' + rootpath,
                       branch, dirpath])